Skip to main content

GetLock

Returns the lock type of the current container.

Syntax

expression.GetLock();

expression - A variable that represents a ApiBlockLvlSdt class.

Parameters

This method doesn't have any parameters.

Returns

SdtLock

Example

This example shows how to get the lock type of the container.

let doc = Api.GetDocument();
let blockLvlSdt = Api.CreateBlockLvlSdt();
blockLvlSdt.GetContent().GetElement(0).AddText("This is a block text content control with the content lock set to it.");
blockLvlSdt.SetLock("sdtContentLocked");
doc.AddElement(0, blockLvlSdt);
doc.GetElement(1).AddText("Lock type: " + blockLvlSdt.GetLock());